package com.zlsy.secondtime.threadcoreknowledge.uncaughtexception;

import lombok.extern.slf4j.Slf4j;

/**
 * @author zhouliang
 * @date 2020/5/19 13:29
 */
@Slf4j
public class MyUncaughtExceptionHandlerHandler implements Thread.UncaughtExceptionHandler {

    private String name;

    public MyUncaughtExceptionHandlerHandler(String name) {
        this.name = name;
    }

    @Override
    public void uncaughtException(Thread t, Throwable e) {
        log.error("线程异常终止了，线程名字：{},异常：{}", t.getName(), e);
    }
}
